//聊天表

var mongoose = require('mongoose');


var ChatSchema = new mongoose.Schema({
    user_id: { type: mongoose.SchemaTypes.ObjectId, ref: 'user_login'  },//用户id
    friend_id: { type: mongoose.SchemaTypes.ObjectId, ref: 'user_login' }, //好友ID
    issend: { type: String, required: true }, //发送消息
    chat_content: { type: String, required: true },// 聊天内容
    chat_content_time: { type: Date , required: true}//内容发布时间
})

module.exports = mongoose.model('Chat', ChatSchema)  